{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "e8b2f5eb",
   "metadata": {
    "editable": true,
    "slideshow": {
     "slide_type": ""
    },
    "tags": []
   },
   "source": [
    "# Access Control\n",
    "\n",
    "<a href=\"http://35.236.121.59/hub/user-redirect/git-pull?repo=https%3A%2F%2Fgithub.com%2Fproject-chip%2Fconnectedhomeip&urlpath=lab%2Ftree%2Fconnectedhomeip%2Fdocs%2Fguides%2Frepl%2FMatter%2520-%2520Access%2520Control.ipynb&branch=master\">\n",
    "<img src=\"https://i.ibb.co/hR3yWsC/launch-playground.png\" alt=\"drawing\" width=\"130\"/>\n",
    "</a>\n",
    "<br></br>\n",
    "\n",
    "This document explains how to use Access Control in Matter, and will be updated as development proceeds."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2dce5632",
   "metadata": {},
   "source": [
    "## What Does and Doesn’t Work Right Now?\n",
    "\n",
    "Briefly, you can read and write the entire ACL attribute in the all-clusters-app, but Access Control isn’t yet turned on, so it won’t affect interactions. There’s almost no error checking when writing the ACL attribute (e.g. ensuring subjects match auth mode, only your fabric can be written, etc.) so exercise caution for now."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "be8d3d64-e3d3-46b9-bbea-29aba67aee3b",
   "metadata": {},
   "source": [
    "## Clear Persisted Storage\n",
    "\n",
    "Let's clear out our persisted storage (if one exists) to start from a clean slate."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "59352193-6c8f-4bda-9a3c-d84317b63c30",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import os, subprocess\n",
    "\n",
    "if os.path.isfile('/tmp/repl-storage.json'):\n",
    "    os.remove('/tmp/repl-storage.json')\n",
    "\n",
    "# So that the all-clusters-app won't boot with stale prior state.\n",
    "os.system('rm -rf /tmp/chip_*')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "99ce2877",
   "metadata": {
    "tags": []
   },
   "source": [
    "## Initialization\n",
    "\n",
    "Let's first begin by setting up by importing some key modules that are needed to make it easier for us to interact with the Matter stack.\n",
    "\n",
    "> **NOTE**: _This is not needed if you launch the REPL from the command-line._"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "bad327b7-c78a-4c46-b224-077fe7539ee1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n",
       "<span style=\"font-weight: bold\"> Replacing </span> store path .<span style=\"color: #800080; text-decoration-color: #800080\">/credentials/development/</span><span style=\"color: #ff00ff; text-decoration-color: #ff00ff\">paa-root-certs</span> with \n",
       "<span style=\"color: #800080; text-decoration-color: #800080\">/home/root/repos/connectedhomeip/credentials/development/</span><span style=\"color: #ff00ff; text-decoration-color: #ff00ff\">paa-root-certs</span>\n",
       "Note that you are still running from \n",
       "<span style=\"color: #800080; text-decoration-color: #800080\">/home/root/repos/connectedhomeip/docs/development_controllers/</span><span style=\"color: #ff00ff; text-decoration-color: #ff00ff\">matter-repl</span> so other relative\n",
       "paths may be off.\n",
       "                    \n",
       "</pre>\n"
      ],
      "text/plain": [
       "\n",
       "\u001b[1m Replacing \u001b[0m store path .\u001b[35m/credentials/development/\u001b[0m\u001b[95mpaa-root-certs\u001b[0m with \n",
       "\u001b[35m/home/root/repos/connectedhomeip/credentials/development/\u001b[0m\u001b[95mpaa-root-certs\u001b[0m\n",
       "Note that you are still running from \n",
       "\u001b[35m/home/root/repos/connectedhomeip/docs/development_controllers/\u001b[0m\u001b[95mmatter-repl\u001b[0m so other relative\n",
       "paths may be off.\n",
       "                    \n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1738153365.139353][2283552:2283552] CHIP:CTL: Setting attestation nonce to random value\n",
      "[1738153365.139578][2283552:2283552] CHIP:CTL: Setting CSR nonce to random value\n",
      "[1738153365.151683][2283552:2283552] CHIP:DL: NVS set: chip-factory/unique-id = \"107DC5BE4DC63F48\"\n",
      "[1738153365.152834][2283552:2283552] CHIP:DL: NVS set: chip-factory/vendor-id = 65521 (0xFFF1)\n",
      "[1738153365.154302][2283552:2283552] CHIP:DL: NVS set: chip-factory/product-id = 32769 (0x8001)\n",
      "[1738153365.155697][2283552:2283552] CHIP:DL: NVS set: chip-counters/reboot-count = 1 (0x1)\n",
      "[1738153365.157205][2283552:2283552] CHIP:DL: NVS set: chip-counters/total-operational-hours = 0 (0x0)\n",
      "[1738153365.158744][2283552:2283552] CHIP:DL: NVS set: chip-counters/boot-reason = 0 (0x0)\n",
      "[1738153365.160171][2283552:2283552] CHIP:DL: NVS set: chip-config/regulatory-location = 0 (0x0)\n",
      "[1738153365.161859][2283552:2283552] CHIP:DL: NVS set: chip-config/location-capability = 2 (0x2)\n",
      "[1738153365.162176][2283552:2283552] CHIP:DL: Got Ethernet interface: enp2s0\n",
      "[1738153365.162304][2283552:2283552] CHIP:DL: Found the primary Ethernet interface:enp2s0\n",
      "[1738153365.162434][2283552:2283552] CHIP:DL: Got WiFi interface: wlp3s0\n",
      "[1738153365.162584][2283552:2283552] CHIP:DL: Found the primary WiFi interface:wlp3s0\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #00ff00; text-decoration-color: #00ff00\">─────────────────────────────────────────────────── </span>Matter REPL<span style=\"color: #00ff00; text-decoration-color: #00ff00\"> ───────────────────────────────────────────────────</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[92m─────────────────────────────────────────────────── \u001b[0mMatter REPL\u001b[92m ───────────────────────────────────────────────────\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n",
       "            \n",
       "\n",
       "<span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">            Welcome to the Matter Python REPL!</span>\n",
       "\n",
       "<span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">            For help, please type </span><span style=\"color: #008000; text-decoration-color: #008000; font-weight: bold\">matterhelp()</span>\n",
       "\n",
       "<span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">            To get more information on a particular object/class, you can pass</span>\n",
       "<span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">            that into </span><span style=\"color: #008000; text-decoration-color: #008000; font-weight: bold\">matterhelp()</span><span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\"> as well.</span>\n",
       "\n",
       "<span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">            </span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\n",
       "            \n",
       "\n",
       "\u001b[1;34m            Welcome to the Matter Python REPL!\u001b[0m\n",
       "\n",
       "\u001b[1;34m            For help, please type \u001b[0m\u001b[1;32mmatterhelp\u001b[0m\u001b[1;32m(\u001b[0m\u001b[1;32m)\u001b[0m\n",
       "\n",
       "\u001b[1;34m            To get more information on a particular object/class, you can pass\u001b[0m\n",
       "\u001b[1;34m            that into \u001b[0m\u001b[1;32mmatterhelp\u001b[0m\u001b[1;32m(\u001b[0m\u001b[1;32m)\u001b[0m\u001b[1;34m as well.\u001b[0m\n",
       "\n",
       "\u001b[1;34m            \u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #00ff00; text-decoration-color: #00ff00\">───────────────────────────────────────────────────────────────────────────────────────────────────────────────────</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[92m───────────────────────────────────────────────────────────────────────────────────────────────────────────────────\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2025-01-29 13:22:45 ThinkPad matter.storage[2283552] ERROR [Errno 2] No such file or directory: '/tmp/repl-storage.json'\n",
      "2025-01-29 13:22:45 ThinkPad matter.storage[2283552] CRITICAL Could not load configuration from /tmp/repl-storage.json - resetting configuration...\n",
      "2025-01-29 13:22:45 ThinkPad matter.storage[2283552] WARNING No valid SDK configuration present - clearing out configuration\n",
      "2025-01-29 13:22:45 ThinkPad matter.storage[2283552] WARNING No valid REPL configuration present - clearing out configuration\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n",
       "\n",
       "<span style=\"color: #000080; text-decoration-color: #000080\">The following objects have been created:</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\n",
       "\n",
       "\u001b[34mThe following objects have been created:\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">        <span style=\"color: #800000; text-decoration-color: #800000\">certificateAuthorityManager</span><span style=\"color: #000080; text-decoration-color: #000080\">:    Manages a list of CertificateAuthority instances.</span>\n",
       "<span style=\"color: #000080; text-decoration-color: #000080\">        </span><span style=\"color: #800000; text-decoration-color: #800000\">caList</span><span style=\"color: #000080; text-decoration-color: #000080\">:                         The list of CertificateAuthority instances.</span>\n",
       "<span style=\"color: #000080; text-decoration-color: #000080\">        </span><span style=\"color: #800000; text-decoration-color: #800000\">caList</span><span style=\"color: #800000; text-decoration-color: #800000; font-weight: bold\">[</span><span style=\"color: #800000; text-decoration-color: #800000\">n</span><span style=\"color: #800000; text-decoration-color: #800000; font-weight: bold\">]</span><span style=\"color: #800000; text-decoration-color: #800000\">.adminList</span><span style=\"color: #800000; text-decoration-color: #800000; font-weight: bold\">[</span><span style=\"color: #800000; text-decoration-color: #800000\">m</span><span style=\"color: #800000; text-decoration-color: #800000; font-weight: bold\">]</span><span style=\"color: #000080; text-decoration-color: #000080\">:         A specific FabricAdmin object at index m for the nth CertificateAuthority </span>\n",
       "<span style=\"color: #000080; text-decoration-color: #000080\">instance.</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "        \u001b[31mcertificateAuthorityManager\u001b[0m\u001b[34m:    \u001b[0m\u001b[34mManages a list of CertificateAuthority instances.\u001b[0m\n",
       "\u001b[34m        \u001b[0m\u001b[31mcaList\u001b[0m\u001b[34m: \u001b[0m\u001b[34m        \u001b[0m\u001b[34m        \u001b[0m\u001b[34m        \u001b[0m\u001b[34mThe list of CertificateAuthority instances.\u001b[0m\n",
       "\u001b[34m        \u001b[0m\u001b[31mcaList\u001b[0m\u001b[1;31m[\u001b[0m\u001b[31mn\u001b[0m\u001b[1;31m]\u001b[0m\u001b[31m.adminList\u001b[0m\u001b[1;31m[\u001b[0m\u001b[31mm\u001b[0m\u001b[1;31m]\u001b[0m\u001b[34m: \u001b[0m\u001b[34m        \u001b[0m\u001b[34mA specific FabricAdmin object at index m for the nth CertificateAuthority \u001b[0m\n",
       "\u001b[34minstance.\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n",
       "\n",
       "<span style=\"color: #000080; text-decoration-color: #000080\">Default CHIP Device Controller </span><span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">(</span><span style=\"color: #000080; text-decoration-color: #000080\">NodeId: </span><span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">112233</span><span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">)</span><span style=\"color: #000080; text-decoration-color: #000080\">: has been initialized to manage </span><span style=\"color: #800000; text-decoration-color: #800000; font-weight: bold\">caList[</span><span style=\"color: #800000; text-decoration-color: #800000; font-weight: bold\">0</span><span style=\"color: #800000; text-decoration-color: #800000; font-weight: bold\">].adminList[</span><span style=\"color: #800000; text-decoration-color: #800000; font-weight: bold\">0</span><span style=\"color: #800000; text-decoration-color: #800000; font-weight: bold\">]</span><span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\"> (FabricId = </span>\n",
       "<span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">1</span><span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">), and is available as </span><span style=\"color: #800000; text-decoration-color: #800000; font-weight: bold\">devCtrl</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\n",
       "\n",
       "\u001b[34mDefault CHIP Device Controller \u001b[0m\u001b[1;34m(\u001b[0m\u001b[34mNodeId: \u001b[0m\u001b[1;34m112233\u001b[0m\u001b[1;34m)\u001b[0m\u001b[34m: has been initialized to manage \u001b[0m\u001b[1;31mcaList\u001b[0m\u001b[1;31m[\u001b[0m\u001b[1;31m0\u001b[0m\u001b[1;31m]\u001b[0m\u001b[1;31m.adminList\u001b[0m\u001b[1;31m[\u001b[0m\u001b[1;31m0\u001b[0m\u001b[1;31m]\u001b[0m\u001b[1;34m \u001b[0m\u001b[1;34m(\u001b[0m\u001b[1;34mFabricId = \u001b[0m\n",
       "\u001b[1;34m1\u001b[0m\u001b[1;34m)\u001b[0m\u001b[1;34m, and is available as \u001b[0m\u001b[1;31mdevCtrl\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%reset -f\n",
    "import importlib.util\n",
    "spec = importlib.util.find_spec('matter.ReplStartup')\n",
    "%run {spec.origin}"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7a082d33-bebd-4b34-b8e3-df59ed429c54",
   "metadata": {},
   "source": [
    "## Commission and Setup Server"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9cb06305",
   "metadata": {},
   "source": [
    "### Launch Server\n",
    "\n",
    "Let's launch an instance of the `chip-all-clusters-app`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "52ccd8c6",
   "metadata": {},
   "outputs": [],
   "source": [
    "import time, os\n",
    "import subprocess\n",
    "os.system('pkill -f chip-all-clusters-app')\n",
    "time.sleep(1)\n",
    "\n",
    "appPath = '../../../out/linux-x64-all-clusters/chip-all-clusters-app'\n",
    "process = subprocess.Popen(appPath, stdout=subprocess.DEVNULL)\n",
    "time.sleep(1)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b33dec2e",
   "metadata": {},
   "source": [
    "### Commission Target\n",
    "\n",
    "Commission the target with a NodeId of 2."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "5e964fe3",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"></pre>\n"
      ],
      "text/plain": []
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "\u001b[1;36m2\u001b[0m"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "await devCtrl.CommissionOnNetwork(2, 20202021)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c22ea8ee",
   "metadata": {
    "tags": []
   },
   "source": [
    "## Bootstrap ACLs"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "372ae9a4",
   "metadata": {},
   "source": [
    "During Commissioning, an ACL that assigns Administer rights to the commissioner(i.e. matter-repl) was automatically installed on the commissionee."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "058504b3",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"></pre>\n"
      ],
      "text/plain": []
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "\n",
       "\u001b[1m{\u001b[0m\n",
       "\u001b[2;32m│   \u001b[0m\u001b[1;36m0\u001b[0m: \u001b[1m{\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'matter.clusters.Objects.OperationalCredentials'\u001b[0m\u001b[39m>: \u001b[0m\u001b[1;35mOperationalCredentials\u001b[0m\u001b[1;39m(\u001b[0m\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[1;39m(\u001b[0m\u001b[39mdata version\u001b[0m\u001b[1;39m)\u001b[0m\u001b[39m=\u001b[0m\u001b[1;36m3950260077\u001b[0m\u001b[39m,\u001b[0m\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[33mNOCs\u001b[0m\u001b[39m=\u001b[0m\u001b[1;39m[\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;35mNOCStruct\u001b[0m\u001b[1;39m(\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33mnoc\u001b[0m\u001b[39m=\u001b[0m\u001b[32mb\u001b[0m\u001b[32m'\\x150\\x01\\x01\\x01$\\x02\\x017\\x03$\\x13\\x02\\x18&\\x04\\x80\"\\x81\\'&\\x05\\x80%M:7\\x06$\\x15\\x01$\\x11\\x02\\x18$\\x07\\x01$\\x08\\x010\\tA\\x04\\xbe1\\xb2Q\\xd2\\xc2\\x1fn\\x9b\\xc1\\xe5\u001b[0m\u001b[32m}\u001b[0m\u001b[32m\\x188\\xca\\x08B\\x05MOu\\xd0\\xb4\\xbb\\x9d\\xeaS\\xa6\\xb0\\xb7\\xc8\\x90\\xd2\\x0b\\xc2I\\xa1\\x1e\\xee\\x92\\xa9P\\x02\\xc2\\xe8~p\\x07\\xb7\\x86&\\x01\\x15\\xcdl\\x838\\x8f\\x12s_\\xd6\\x8d77\\n5\\x01\u001b[0m\u001b[32m(\u001b[0m\u001b[32m\\x01\\x18$\\x02\\x016\\x03\\x04\\x02\\x04\\x01\\x180\\x04\\x14D\\x99T\\xc8\\\\Q\\xb4\\x10cD\\x9dC\u001b[0m\u001b[32m>\u001b[0m\u001b[32mn\"5\\xf5<Q|0\\x05\\x14\\xc9\\x9b\\xd7\\xa7d0k\\x05\\xaf\\xd8W\\x91\\x982\\x19\\xb9\\xed\\xda\\x7f \\x180\\x0b@\\xfd\\xb0v_\\x1f\\x8c\\xc8\\xa0\\xb3b\\n\\x8c\\x13X\\x1f\\xf0*\\xf7\\xd2\\x93\\xaaN\\xbd/\\xa6\\x99\\xc5\\xa2\\\\\\xcb\\xbd\\xcb\\x8e\\xfbD\\xd5\\xdd\\xd1\\xc7\\xe1H\\xd9\\x8c\\xefEU\\xccG\\x92!\\x94\\xd1:P\\x0eqU\\xb9\\x94\\x9e6\\x96z\\x1c\\x18'\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33micac\u001b[0m=\u001b[32mb\u001b[0m\u001b[32m'\\x150\\x01\\x01\\x01$\\x02\\x017\\x03$\\x14\\x01\\x18&\\x04\\x80\"\\x81\\'&\\x05\\x80%M:7\\x06$\\x13\\x02\\x18$\\x07\\x01$\\x08\\x010\\tA\\x04\\xe3FL\\xe7\\xef\\xfc\\xc2\\x93\\x17\\x90X\\x93\\xed\\xc6\\xc8e\\x99\\xe5?.\\xd9\\xc5\\x06\\x17F\u001b[0m\u001b[32m(\u001b[0m\u001b[32m\\xe7X\\xc9\\xb9\\xc5\\xb6\\xc6\\xb2i\\x8e\\x07-Zkk\\xef$\\xac\\x95\\x10\\t\\x8fh\\xfb\\xa4\\n\\xc4\\xa4\u001b[0m\u001b[32m}\u001b[0m\u001b[32m*\\xc7\\xe6\\xa2r\\xb9\\x85\u001b[0m\u001b[32m{\u001b[0m\u001b[32m\\xa17\\n5\\x01\u001b[0m\u001b[32m)\u001b[0m\u001b[32m\\x01\\x18$\\x02`0\\x04\\x14\\xc9\\x9b\\xd7\\xa7d0k\\x05\\xaf\\xd8W\\x91\\x982\\x19\\xb9\\xed\\xda\\x7f 0\\x05\\x14\\xd3\\x10\\x1e\"r`h-\\xb6\\x16\\xda\\x9a\\x88\\xa4\\xafxk\\xa5\\x88\\'\\x180\\x0b@\\xf3\\xb6\\xbe\\xd1\\n\\x9eO\\x1c\\xda-ZB\\x05\\x16\\x8c\\xfd?q\u001b[0m\u001b[32m}\u001b[0m\u001b[32m\\xb8pskG\\x8f\\\u001b[0m\u001b[32mxc4\u001b[0m\u001b[32m=\\x1dw\\\\\\xcc\\xc1/Ue\\x1e\\xb60c\\x10\\x0f\\x80\\x93V$\\n\\xab\\x01\\xd9s\\x80\u001b[0m\u001b[32m[\u001b[0m\u001b[32m\\xfc\\x86\\xe8\\xe8ZJ\\x10<\\xdf\\x8f\\xb1W\\x18'\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33mfabricIndex\u001b[0m=\u001b[1;36m1\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1m)\u001b[0m\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[1m]\u001b[0m,\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[33mfabrics\u001b[0m=\u001b[1m[\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;35mFabricDescriptorStruct\u001b[0m\u001b[1m(\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33mrootPublicKey\u001b[0m=\u001b[32mb\u001b[0m\u001b[32m'\\x04\\x11\\xb0-\\x12\\x808\\xb9<\\xce\\x84\\xff?\\x94\\xc8|\u001b[0m\u001b[32m}\u001b[0m\u001b[32md\\xa5K_\u001b[0m\u001b[32m{\u001b[0m\u001b[32m5\\x12\\'H\\xb9\\x10\\x05m\\xc0N\u001b[0m\u001b[32m]\u001b[0m\u001b[32m|\\x04\\xc3\\x96M\\xa1\\x06\\xdat_`yG\u001b[0m\u001b[32m{\u001b[0m\u001b[32m\\xeb:\\xf0\"VJ\\xd2\\x9a\\x9f\\xb5\\x1e\\x90\\x95\\xc6B\\xf6\\xcb\\x07'\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33mvendorID\u001b[0m=\u001b[1;36m65521\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33mfabricID\u001b[0m=\u001b[1;36m1\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33mnodeID\u001b[0m=\u001b[1;36m2\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33mlabel\u001b[0m=\u001b[32m''\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33mfabricIndex\u001b[0m=\u001b[1;36m1\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1m)\u001b[0m\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[1m]\u001b[0m,\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[33msupportedFabrics\u001b[0m=\u001b[1;36m16\u001b[0m,\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[33mcommissionedFabrics\u001b[0m=\u001b[1;36m1\u001b[0m,\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[33mtrustedRootCertificates\u001b[0m=\u001b[1m[\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[32mb'\\x150\\x01\\x01\\x01$\\x02\\x017\\x03$\\x14\\x01\\x18&\\x04\\x80\"\\x81\\'&\\x05\\x80%M:7\\x06$\\x14\\x01\\x18$\\x07\\x01$\\x08\\x010\\tA\\x04\\x11\\xb0-\\x12\\x808\\xb9<\\xce\\x84\\xff?\\x94\\xc8|\u001b[0m\u001b[32m}\u001b[0m\u001b[32md\\xa5K_\u001b[0m\u001b[32m{\u001b[0m\u001b[32m5\\x12\\'H\\xb9\\x10\\x05m\\xc0N\u001b[0m\u001b[32m]\u001b[0m\u001b[32m|\\x04\\xc3\\x96M\\xa1\\x06\\xdat_`yG\u001b[0m\u001b[32m{\u001b[0m\u001b[32m\\xeb:\\xf0\"VJ\\xd2\\x9a\\x9f\\xb5\\x1e\\x90\\x95\\xc6B\\xf6\\xcb\\x077\\n5\\x01\u001b[0m\u001b[32m)\u001b[0m\u001b[32m\\x01\\x18$\\x02`0\\x04\\x14\\xd3\\x10\\x1e\"r`h-\\xb6\\x16\\xda\\x9a\\x88\\xa4\\xafxk\\xa5\\x88\\'0\\x05\\x14\\xd3\\x10\\x1e\"r`h-\\xb6\\x16\\xda\\x9a\\x88\\xa4\\xafxk\\xa5\\x88\\'\\x180\\x0b@\\xf7g\\xb2\\xc6F\\x87\\xda\\xb6w\\xe7h\\xf7\\x11\\xe8w8\\xc15\\xd6\\x0e\\xc4\\xeb\\x04\\xffEq\\xdc\\xcf\\x15\\xe7F\\x1fp\\xb95\\xe9\\xf7\\x1d/=\\xfdF\\xe2\\xa4\\xc3%\\x06m\\xa73dN\\x14I\\x0e\\\\\\x8b\\xd5W\\xc3\\x99\\xb4\\xdc\\t\\x18'\u001b[0m\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[1m]\u001b[0m,\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[33mcurrentFabricIndex\u001b[0m=\u001b[1;36m1\u001b[0m,\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[33mgeneratedCommandList\u001b[0m=\u001b[1m[\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;36m1\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;36m3\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;36m5\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;36m8\u001b[0m\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[1m]\u001b[0m,\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[33macceptedCommandList\u001b[0m=\u001b[1m[\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;36m0\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;36m2\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;36m4\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;36m6\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;36m7\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;36m9\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;36m10\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;36m11\u001b[0m\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[1m]\u001b[0m,\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[33mattributeList\u001b[0m=\u001b[1m[\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;36m0\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;36m1\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;36m2\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;36m3\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;36m4\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;36m5\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;36m65528\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;36m65529\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;36m65531\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;36m65532\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;36m65533\u001b[0m\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[1m]\u001b[0m,\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[33mfeatureMap\u001b[0m=\u001b[1;36m0\u001b[0m,\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[33mclusterRevision\u001b[0m=\u001b[1;36m1\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[1m)\u001b[0m\n",
       "\u001b[2;32m│   \u001b[0m\u001b[1m}\u001b[0m\n",
       "\u001b[1m}\u001b[0m"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "await devCtrl.ReadAttribute(2, [ (0, Clusters.OperationalCredentials)], returnClusterObject=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d8bbcae5-f549-4dd2-8804-9bbf9313fce1",
   "metadata": {},
   "source": [
    "### Automatically Installed ACL"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "5ab2bffe",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"></pre>\n"
      ],
      "text/plain": []
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "\n",
       "\u001b[1m{\u001b[0m\n",
       "\u001b[2;32m│   \u001b[0m\u001b[1;36m0\u001b[0m: \u001b[1m{\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'matter.clusters.Objects.AccessControl'\u001b[0m\u001b[39m>: \u001b[0m\u001b[1;39m{\u001b[0m\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[39m<class \u001b[0m\u001b[32m'matter.clusters.Attribute.DataVersion'\u001b[0m\u001b[39m>: \u001b[0m\u001b[1;36m318338779\u001b[0m\u001b[39m,\u001b[0m\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[39m<class \u001b[0m\u001b[32m'matter.clusters.Objects.AccessControl.Attributes.Acl'\u001b[0m\u001b[39m>: \u001b[0m\u001b[1;39m[\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;35mAccessControlEntryStruct\u001b[0m\u001b[1;39m(\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33mprivilege\u001b[0m\u001b[39m=<AccessControlEntryPrivilegeEnum.kAdminister: \u001b[0m\u001b[1;36m5\u001b[0m\u001b[39m>,\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33mauthMode\u001b[0m\u001b[39m=<AccessControlEntryAuthModeEnum.kCase: \u001b[0m\u001b[1;36m2\u001b[0m\u001b[1m>\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33msubjects\u001b[0m=\u001b[1m[\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   │   \u001b[0m\u001b[1;36m112233\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[1m]\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33mtargets\u001b[0m=\u001b[35mNull\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33mfabricIndex\u001b[0m=\u001b[1;36m1\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1m)\u001b[0m\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[1m]\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[1m}\u001b[0m\n",
       "\u001b[2;32m│   \u001b[0m\u001b[1m}\u001b[0m\n",
       "\u001b[1m}\u001b[0m"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = await devCtrl.ReadAttribute(2, [ (0, Clusters.AccessControl.Attributes.Acl) ] )\n",
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "ae25b644-abc6-4de6-b098-5fbde2409dc4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"></pre>\n"
      ],
      "text/plain": []
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "\n",
       "\u001b[1m[\u001b[0m\n",
       "\u001b[2;32m│   \u001b[0m\u001b[1;35mAccessControlEntryStruct\u001b[0m\u001b[1m(\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33mprivilege\u001b[0m=\u001b[1m<\u001b[0m\u001b[1;95mAccessControlEntryPrivilegeEnum.kAdminister:\u001b[0m\u001b[39m \u001b[0m\u001b[1;36m5\u001b[0m\u001b[39m>,\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33mauthMode\u001b[0m\u001b[39m=<AccessControlEntryAuthModeEnum.kCase: \u001b[0m\u001b[1;36m2\u001b[0m\u001b[1m>\u001b[0m,\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33msubjects\u001b[0m=\u001b[1m[\u001b[0m\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[1;36m112233\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[1m]\u001b[0m,\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33mtargets\u001b[0m=\u001b[35mNull\u001b[0m,\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33mfabricIndex\u001b[0m=\u001b[1;36m1\u001b[0m\n",
       "\u001b[2;32m│   \u001b[0m\u001b[1m)\u001b[0m\n",
       "\u001b[1m]\u001b[0m"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "acl = data[0][matter.clusters.Objects.AccessControl][matter.clusters.Objects.AccessControl.Attributes.Acl]\n",
    "acl"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0fef25ad-0b5e-447d-ac36-8e24dee1fd35",
   "metadata": {},
   "source": [
    "### Installing a CASE ACL"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "605f44c4-6abe-4a7b-87e4-9b1e677f9cfe",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"></pre>\n"
      ],
      "text/plain": []
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "\n",
       "\u001b[1m[\u001b[0m\n",
       "\u001b[2;32m│   \u001b[0m\u001b[1;35mAccessControlEntryStruct\u001b[0m\u001b[1m(\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33mprivilege\u001b[0m=\u001b[1m<\u001b[0m\u001b[1;95mAccessControlEntryPrivilegeEnum.kAdminister:\u001b[0m\u001b[39m \u001b[0m\u001b[1;36m5\u001b[0m\u001b[39m>,\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33mauthMode\u001b[0m\u001b[39m=<AccessControlEntryAuthModeEnum.kCase: \u001b[0m\u001b[1;36m2\u001b[0m\u001b[39m>,\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33msubjects\u001b[0m\u001b[39m=\u001b[0m\u001b[1;39m[\u001b[0m\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[1;36m112233\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[1;39m]\u001b[0m\u001b[39m,\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33mtargets\u001b[0m\u001b[39m=\u001b[0m\u001b[35mNull\u001b[0m\u001b[39m,\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33mfabricIndex\u001b[0m\u001b[39m=\u001b[0m\u001b[1;36m1\u001b[0m\n",
       "\u001b[2;32m│   \u001b[0m\u001b[1;39m)\u001b[0m\u001b[39m,\u001b[0m\n",
       "\u001b[2;32m│   \u001b[0m\u001b[1;35mAccessControlEntryStruct\u001b[0m\u001b[1;39m(\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33mprivilege\u001b[0m\u001b[39m=<AccessControlEntryPrivilegeEnum.kOperate: \u001b[0m\u001b[1;36m3\u001b[0m\u001b[39m>,\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33mauthMode\u001b[0m\u001b[39m=<AccessControlEntryAuthModeEnum.kCase: \u001b[0m\u001b[1;36m2\u001b[0m\u001b[1m>\u001b[0m,\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33msubjects\u001b[0m=\u001b[35mNull\u001b[0m,\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33mtargets\u001b[0m=\u001b[1m[\u001b[0m\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[1;35mAccessControlTargetStruct\u001b[0m\u001b[1m(\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[33mcluster\u001b[0m=\u001b[35mNull\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[33mendpoint\u001b[0m=\u001b[1;36m1\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[33mdeviceType\u001b[0m=\u001b[35mNull\u001b[0m\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[1m)\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[1m]\u001b[0m,\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33mfabricIndex\u001b[0m=\u001b[1;36m1\u001b[0m\n",
       "\u001b[2;32m│   \u001b[0m\u001b[1m)\u001b[0m\n",
       "\u001b[1m]\u001b[0m"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "acl.append(Clusters.AccessControl.Structs.AccessControlEntryStruct(\n",
    "    fabricIndex = 1,\n",
    "    privilege = Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kOperate,\n",
    "    authMode = Clusters.AccessControl.Enums.AccessControlEntryAuthModeEnum.kCase,\n",
    "    targets = [ Clusters.AccessControl.Structs.AccessControlTargetStruct(\n",
    "        endpoint = 1,\n",
    "    ) ] ) )\n",
    "acl"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "66cce24d-c1d4-434c-ab1a-d391b1b8e660",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"></pre>\n"
      ],
      "text/plain": []
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "\n",
       "\u001b[1m[\u001b[0m\n",
       "\u001b[2;32m│   \u001b[0m\u001b[1;35mAttributeStatus\u001b[0m\u001b[1m(\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33mPath\u001b[0m=\u001b[1;35mAttributePath\u001b[0m\u001b[1m(\u001b[0m\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[33mEndpointId\u001b[0m=\u001b[1;36m0\u001b[0m,\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[33mClusterId\u001b[0m=\u001b[1;36m31\u001b[0m,\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[33mAttributeId\u001b[0m=\u001b[1;36m0\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[1m)\u001b[0m,\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33mStatus\u001b[0m=\u001b[1m<\u001b[0m\u001b[1;95mStatus.Success:\u001b[0m\u001b[39m \u001b[0m\u001b[1;36m0\u001b[0m\u001b[1m>\u001b[0m\n",
       "\u001b[2;32m│   \u001b[0m\u001b[1m)\u001b[0m\n",
       "\u001b[1m]\u001b[0m"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "await devCtrl.WriteAttribute(2, [ (0, Clusters.AccessControl.Attributes.Acl( acl ) ) ] )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "64f7f5e3-64d1-4b2b-a777-e07f5ef86681",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"></pre>\n"
      ],
      "text/plain": []
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "\n",
       "\u001b[1m{\u001b[0m\n",
       "\u001b[2;32m│   \u001b[0m\u001b[1;36m0\u001b[0m: \u001b[1m{\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'matter.clusters.Objects.AccessControl'\u001b[0m\u001b[39m>: \u001b[0m\u001b[1;39m{\u001b[0m\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[39m<class \u001b[0m\u001b[32m'matter.clusters.Attribute.DataVersion'\u001b[0m\u001b[39m>: \u001b[0m\u001b[1;36m318338782\u001b[0m\u001b[39m,\u001b[0m\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[39m<class \u001b[0m\u001b[32m'matter.clusters.Objects.AccessControl.Attributes.Acl'\u001b[0m\u001b[39m>: \u001b[0m\u001b[1;39m[\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;35mAccessControlEntryStruct\u001b[0m\u001b[1;39m(\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33mprivilege\u001b[0m\u001b[39m=<AccessControlEntryPrivilegeEnum.kAdminister: \u001b[0m\u001b[1;36m5\u001b[0m\u001b[39m>,\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33mauthMode\u001b[0m\u001b[39m=<AccessControlEntryAuthModeEnum.kCase: \u001b[0m\u001b[1;36m2\u001b[0m\u001b[39m>,\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33msubjects\u001b[0m\u001b[39m=\u001b[0m\u001b[1;39m[\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   │   \u001b[0m\u001b[1;36m112233\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[1;39m]\u001b[0m\u001b[39m,\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33mtargets\u001b[0m\u001b[39m=\u001b[0m\u001b[35mNull\u001b[0m\u001b[39m,\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33mfabricIndex\u001b[0m\u001b[39m=\u001b[0m\u001b[1;36m1\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;39m)\u001b[0m\u001b[39m,\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;35mAccessControlEntryStruct\u001b[0m\u001b[1;39m(\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33mprivilege\u001b[0m\u001b[39m=<AccessControlEntryPrivilegeEnum.kOperate: \u001b[0m\u001b[1;36m3\u001b[0m\u001b[39m>,\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33mauthMode\u001b[0m\u001b[39m=<AccessControlEntryAuthModeEnum.kCase: \u001b[0m\u001b[1;36m2\u001b[0m\u001b[1m>\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33msubjects\u001b[0m=\u001b[35mNull\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33mtargets\u001b[0m=\u001b[1m[\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   │   \u001b[0m\u001b[1;35mAccessControlTargetStruct\u001b[0m\u001b[1m(\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   │   │   \u001b[0m\u001b[33mcluster\u001b[0m=\u001b[35mNull\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   │   │   │   \u001b[0m\u001b[33mendpoint\u001b[0m=\u001b[1;36m1\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   │   │   │   \u001b[0m\u001b[33mdeviceType\u001b[0m=\u001b[35mNull\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   │   \u001b[0m\u001b[1m)\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[1m]\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33mfabricIndex\u001b[0m=\u001b[1;36m1\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1m)\u001b[0m\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[1m]\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[1m}\u001b[0m\n",
       "\u001b[2;32m│   \u001b[0m\u001b[1m}\u001b[0m\n",
       "\u001b[1m}\u001b[0m"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "await devCtrl.ReadAttribute(2, [ (0, Clusters.AccessControl.Attributes.Acl ) ] )"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "92ae8e3a-7c2b-4e92-a673-a5bdb24d6f61",
   "metadata": {},
   "source": [
    "### Installing a Group ACL"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "144996b2-c029-42f0-931d-536bc5d889f7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"></pre>\n"
      ],
      "text/plain": []
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "\n",
       "\u001b[1m[\u001b[0m\n",
       "\u001b[2;32m│   \u001b[0m\u001b[1;35mAccessControlEntryStruct\u001b[0m\u001b[1m(\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33mprivilege\u001b[0m=\u001b[1m<\u001b[0m\u001b[1;95mAccessControlEntryPrivilegeEnum.kAdminister:\u001b[0m\u001b[39m \u001b[0m\u001b[1;36m5\u001b[0m\u001b[39m>,\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33mauthMode\u001b[0m\u001b[39m=<AccessControlEntryAuthModeEnum.kCase: \u001b[0m\u001b[1;36m2\u001b[0m\u001b[39m>,\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33msubjects\u001b[0m\u001b[39m=\u001b[0m\u001b[1;39m[\u001b[0m\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[1;36m112233\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[1;39m]\u001b[0m\u001b[39m,\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33mtargets\u001b[0m\u001b[39m=\u001b[0m\u001b[35mNull\u001b[0m\u001b[39m,\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33mfabricIndex\u001b[0m\u001b[39m=\u001b[0m\u001b[1;36m1\u001b[0m\n",
       "\u001b[2;32m│   \u001b[0m\u001b[1;39m)\u001b[0m\u001b[39m,\u001b[0m\n",
       "\u001b[2;32m│   \u001b[0m\u001b[1;35mAccessControlEntryStruct\u001b[0m\u001b[1;39m(\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33mprivilege\u001b[0m\u001b[39m=<AccessControlEntryPrivilegeEnum.kOperate: \u001b[0m\u001b[1;36m3\u001b[0m\u001b[39m>,\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33mauthMode\u001b[0m\u001b[39m=<AccessControlEntryAuthModeEnum.kCase: \u001b[0m\u001b[1;36m2\u001b[0m\u001b[39m>,\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33msubjects\u001b[0m\u001b[39m=\u001b[0m\u001b[35mNull\u001b[0m\u001b[39m,\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33mtargets\u001b[0m\u001b[39m=\u001b[0m\u001b[1;39m[\u001b[0m\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[1;35mAccessControlTargetStruct\u001b[0m\u001b[1;39m(\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[33mcluster\u001b[0m\u001b[39m=\u001b[0m\u001b[35mNull\u001b[0m\u001b[39m,\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[33mendpoint\u001b[0m\u001b[39m=\u001b[0m\u001b[1;36m1\u001b[0m\u001b[39m,\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[33mdeviceType\u001b[0m\u001b[39m=\u001b[0m\u001b[35mNull\u001b[0m\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[1;39m)\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[1;39m]\u001b[0m\u001b[39m,\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33mfabricIndex\u001b[0m\u001b[39m=\u001b[0m\u001b[1;36m1\u001b[0m\n",
       "\u001b[2;32m│   \u001b[0m\u001b[1;39m)\u001b[0m\u001b[39m,\u001b[0m\n",
       "\u001b[2;32m│   \u001b[0m\u001b[1;35mAccessControlEntryStruct\u001b[0m\u001b[1;39m(\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33mprivilege\u001b[0m\u001b[39m=<AccessControlEntryPrivilegeEnum.kManage: \u001b[0m\u001b[1;36m4\u001b[0m\u001b[39m>,\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33mauthMode\u001b[0m\u001b[39m=<AccessControlEntryAuthModeEnum.kGroup: \u001b[0m\u001b[1;36m3\u001b[0m\u001b[1m>\u001b[0m,\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33msubjects\u001b[0m=\u001b[1m[\u001b[0m\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[1;36m123\u001b[0m,\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[1;36m456\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[1m]\u001b[0m,\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33mtargets\u001b[0m=\u001b[1m[\u001b[0m\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[1;35mAccessControlTargetStruct\u001b[0m\u001b[1m(\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[33mcluster\u001b[0m=\u001b[1;36m6\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[33mendpoint\u001b[0m=\u001b[35mNull\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[33mdeviceType\u001b[0m=\u001b[35mNull\u001b[0m\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[1m)\u001b[0m,\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[1;35mAccessControlTargetStruct\u001b[0m\u001b[1m(\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[33mcluster\u001b[0m=\u001b[35mNull\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[33mendpoint\u001b[0m=\u001b[1;36m1\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[33mdeviceType\u001b[0m=\u001b[35mNull\u001b[0m\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[1m)\u001b[0m,\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[1;35mAccessControlTargetStruct\u001b[0m\u001b[1m(\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[33mcluster\u001b[0m=\u001b[1;36m8\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[33mendpoint\u001b[0m=\u001b[1;36m2\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[33mdeviceType\u001b[0m=\u001b[35mNull\u001b[0m\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[1m)\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[1m]\u001b[0m,\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33mfabricIndex\u001b[0m=\u001b[1;36m0\u001b[0m\n",
       "\u001b[2;32m│   \u001b[0m\u001b[1m)\u001b[0m\n",
       "\u001b[1m]\u001b[0m"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "acl.append( Clusters.AccessControl.Structs.AccessControlEntryStruct(\n",
    "    privilege = Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kManage,\n",
    "    authMode = Clusters.AccessControl.Enums.AccessControlEntryAuthModeEnum.kGroup,\n",
    "    subjects = [ 123, 456 ],\n",
    "    targets = [\n",
    "      Clusters.AccessControl.Structs.AccessControlTargetStruct(\n",
    "        cluster = Clusters.OnOff.id,\n",
    "      ),\n",
    "      Clusters.AccessControl.Structs.AccessControlTargetStruct(\n",
    "        endpoint = 1,\n",
    "      ),\n",
    "      Clusters.AccessControl.Structs.AccessControlTargetStruct(\n",
    "        cluster = Clusters.LevelControl.id,\n",
    "        endpoint = 2,\n",
    "      ) ] ) )\n",
    "acl"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "678d0076-64eb-4d5c-a778-18331f579d38",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"></pre>\n"
      ],
      "text/plain": []
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "\n",
       "\u001b[1m[\u001b[0m\n",
       "\u001b[2;32m│   \u001b[0m\u001b[1;35mAttributeStatus\u001b[0m\u001b[1m(\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33mPath\u001b[0m=\u001b[1;35mAttributePath\u001b[0m\u001b[1m(\u001b[0m\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[33mEndpointId\u001b[0m=\u001b[1;36m0\u001b[0m,\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[33mClusterId\u001b[0m=\u001b[1;36m31\u001b[0m,\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[33mAttributeId\u001b[0m=\u001b[1;36m0\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[1m)\u001b[0m,\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[33mStatus\u001b[0m=\u001b[1m<\u001b[0m\u001b[1;95mStatus.Success:\u001b[0m\u001b[39m \u001b[0m\u001b[1;36m0\u001b[0m\u001b[1m>\u001b[0m\n",
       "\u001b[2;32m│   \u001b[0m\u001b[1m)\u001b[0m\n",
       "\u001b[1m]\u001b[0m"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "await devCtrl.WriteAttribute(2, [ (0, Clusters.AccessControl.Attributes.Acl( acl ) ) ] ) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "202a2f97-33f7-47b6-9e34-730a32a2d454",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"></pre>\n"
      ],
      "text/plain": []
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "\n",
       "\u001b[1m{\u001b[0m\n",
       "\u001b[2;32m│   \u001b[0m\u001b[1;36m0\u001b[0m: \u001b[1m{\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'matter.clusters.Objects.AccessControl'\u001b[0m\u001b[39m>: \u001b[0m\u001b[1;39m{\u001b[0m\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[39m<class \u001b[0m\u001b[32m'matter.clusters.Attribute.DataVersion'\u001b[0m\u001b[39m>: \u001b[0m\u001b[1;36m318338786\u001b[0m\u001b[39m,\u001b[0m\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[39m<class \u001b[0m\u001b[32m'matter.clusters.Objects.AccessControl.Attributes.Acl'\u001b[0m\u001b[39m>: \u001b[0m\u001b[1;39m[\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;35mAccessControlEntryStruct\u001b[0m\u001b[1;39m(\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33mprivilege\u001b[0m\u001b[39m=<AccessControlEntryPrivilegeEnum.kAdminister: \u001b[0m\u001b[1;36m5\u001b[0m\u001b[39m>,\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33mauthMode\u001b[0m\u001b[39m=<AccessControlEntryAuthModeEnum.kCase: \u001b[0m\u001b[1;36m2\u001b[0m\u001b[39m>,\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33msubjects\u001b[0m\u001b[39m=\u001b[0m\u001b[1;39m[\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   │   \u001b[0m\u001b[1;36m112233\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[1;39m]\u001b[0m\u001b[39m,\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33mtargets\u001b[0m\u001b[39m=\u001b[0m\u001b[35mNull\u001b[0m\u001b[39m,\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33mfabricIndex\u001b[0m\u001b[39m=\u001b[0m\u001b[1;36m1\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;39m)\u001b[0m\u001b[39m,\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;35mAccessControlEntryStruct\u001b[0m\u001b[1;39m(\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33mprivilege\u001b[0m\u001b[39m=<AccessControlEntryPrivilegeEnum.kOperate: \u001b[0m\u001b[1;36m3\u001b[0m\u001b[39m>,\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33mauthMode\u001b[0m\u001b[39m=<AccessControlEntryAuthModeEnum.kCase: \u001b[0m\u001b[1;36m2\u001b[0m\u001b[39m>,\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33msubjects\u001b[0m\u001b[39m=\u001b[0m\u001b[35mNull\u001b[0m\u001b[39m,\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33mtargets\u001b[0m\u001b[39m=\u001b[0m\u001b[1;39m[\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   │   \u001b[0m\u001b[1;35mAccessControlTargetStruct\u001b[0m\u001b[1;39m(\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   │   │   \u001b[0m\u001b[33mcluster\u001b[0m\u001b[39m=\u001b[0m\u001b[35mNull\u001b[0m\u001b[39m,\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   │   │   \u001b[0m\u001b[33mendpoint\u001b[0m\u001b[39m=\u001b[0m\u001b[1;36m1\u001b[0m\u001b[39m,\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   │   │   \u001b[0m\u001b[33mdeviceType\u001b[0m\u001b[39m=\u001b[0m\u001b[35mNull\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   │   \u001b[0m\u001b[1;39m)\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[1;39m]\u001b[0m\u001b[39m,\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33mfabricIndex\u001b[0m\u001b[39m=\u001b[0m\u001b[1;36m1\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;39m)\u001b[0m\u001b[39m,\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1;35mAccessControlEntryStruct\u001b[0m\u001b[1;39m(\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33mprivilege\u001b[0m\u001b[39m=<AccessControlEntryPrivilegeEnum.kManage: \u001b[0m\u001b[1;36m4\u001b[0m\u001b[39m>,\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33mauthMode\u001b[0m\u001b[39m=<AccessControlEntryAuthModeEnum.kGroup: \u001b[0m\u001b[1;36m3\u001b[0m\u001b[1m>\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33msubjects\u001b[0m=\u001b[1m[\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   │   \u001b[0m\u001b[1;36m123\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   │   │   \u001b[0m\u001b[1;36m456\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[1m]\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33mtargets\u001b[0m=\u001b[1m[\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   │   \u001b[0m\u001b[1;35mAccessControlTargetStruct\u001b[0m\u001b[1m(\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   │   │   \u001b[0m\u001b[33mcluster\u001b[0m=\u001b[1;36m6\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   │   │   │   \u001b[0m\u001b[33mendpoint\u001b[0m=\u001b[35mNull\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   │   │   │   \u001b[0m\u001b[33mdeviceType\u001b[0m=\u001b[35mNull\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   │   \u001b[0m\u001b[1m)\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   │   │   \u001b[0m\u001b[1;35mAccessControlTargetStruct\u001b[0m\u001b[1m(\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   │   │   \u001b[0m\u001b[33mcluster\u001b[0m=\u001b[35mNull\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   │   │   │   \u001b[0m\u001b[33mendpoint\u001b[0m=\u001b[1;36m1\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   │   │   │   \u001b[0m\u001b[33mdeviceType\u001b[0m=\u001b[35mNull\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   │   \u001b[0m\u001b[1m)\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   │   │   \u001b[0m\u001b[1;35mAccessControlTargetStruct\u001b[0m\u001b[1m(\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   │   │   \u001b[0m\u001b[33mcluster\u001b[0m=\u001b[1;36m8\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   │   │   │   \u001b[0m\u001b[33mendpoint\u001b[0m=\u001b[1;36m2\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   │   │   │   \u001b[0m\u001b[33mdeviceType\u001b[0m=\u001b[35mNull\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   │   \u001b[0m\u001b[1m)\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[1m]\u001b[0m,\n",
       "\u001b[2;32m│   │   │   │   │   \u001b[0m\u001b[33mfabricIndex\u001b[0m=\u001b[1;36m1\u001b[0m\n",
       "\u001b[2;32m│   │   │   │   \u001b[0m\u001b[1m)\u001b[0m\n",
       "\u001b[2;32m│   │   │   \u001b[0m\u001b[1m]\u001b[0m\n",
       "\u001b[2;32m│   │   \u001b[0m\u001b[1m}\u001b[0m\n",
       "\u001b[2;32m│   \u001b[0m\u001b[1m}\u001b[0m\n",
       "\u001b[1m}\u001b[0m"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "await devCtrl.ReadAttribute(2, [ (0, Clusters.AccessControl.Attributes.Acl ) ] )"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
